import {RouterModule, Routes} from "@angular/router";
import {NgModule} from "@angular/core";
import {ArticleComponent} from "./article/article.component";
import {ArticleDetailComponent} from "./article/article-detail/article-detail.component";
import {TwoComponent} from "./two/two.component";

const routes: Routes = [{path: 'two', component: TwoComponent},
  {path: 'one', component: ArticleComponent},
  {path: 'two', component: ArticleDetailComponent},
  {path: '', redirectTo: '/one', pathMatch: 'full'},//  重定向
  {path: '**', redirectTo: '/one', pathMatch: 'full'}];  //  全部导向


@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {
}
